package cn.jiyun.user.mapper;

import cn.jiyun.user.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface UserMapper extends BaseMapper<User> {

    //自定义sql,完成根据年龄统计人数操作
    @Select("SELECT age,COUNT(*) FROM tb_user GROUP BY age")
    List<Map> findCount();
}
